<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Form Object</title>
</head>

<body>
    <form action="" name="login_form">
        账号:
        <input type="text" name="account" id="account_id" required value="aaaa">
        <br> 密码：
        <input type="password" name="pwd" id="pwd_id" required>
        <br>
        <input type="checkbox" name="remember" name="remember" required>记住密码
        <br> 账号类型：
        <select name="role">
            <option value="student">学生</option>
            <option value="teacher" selected>老师</option>
        </select>
        <br>
        <br>
        <button type="submit" onclick="login()">登录</button>
    </form>
    <script>
        function login() {
            var account = document.login_form.account.value;
            // alert(account);
            var pwd = document.login_form.pwd_id.value;
            // alert(pwd);
            var role = document.login_form.role.value;
            alert(role);
        }
    </script>
</body>

</html>